package com.example.nowcodercommunity.dao;

import com.example.nowcodercommunity.entity.LoginTicket;
import org.apache.ibatis.annotations.*;

@Mapper
@Deprecated
public interface LoginTicketMapper {

    @Insert({
            "INSERT INTO loginTicket(user_id,ticket,status,expired)",
            "VALUE(#{userId},#{ticket},#{status},#{expired});"
    })
    int insertLoginTicket(LoginTicket loginTicket);

    @Select({
            "SELECT id,user_id,ticket,status,expired",
            "FROM loginTicket WHERE ticket = #{ticket};"
    })
    LoginTicket selectByTicket(String ticket);

    @Update({
            "UPDATE loginTicket SET status = #{status} WHERE ticket = #{ticket};"
    })
    int updateStatus(String ticket,int status);
}
